#include "ws.token.h"

#ifdef DEBUG
#include <iostream>
#endif

#define NULL 0

TOB::WS::Token* TOB::WS::Token::_self = NULL;

TOB::WS::Token::Token() {
  _counter = -1;
#ifdef DEBUG
  std::cout << "created token: " << this << std::endl;
#endif
}

TOB::WS::Token* TOB::WS::Token::getInstance() {
  if (_self == NULL) {
    _self = new Token();
  }
  return _self;
}

int TOB::WS::Token::getToken() {
  _counter++;
  if (_counter == -1) {
    _counter++;
  }
  return _counter;
}
